Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: log teardown to different file #54687

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

tbg
Copy link
Member

@tbg tbg commented Sep 23, 2020

We perform various operations on teardown which typically produce a few
pages of log output (dead nodes, consistency, getting logs, ...).
These tend to make the real test failure harder to find, so this
commit switches out the loggers before we perform teardown; teardown
will log to teardown.log instead. The main log (test.log) now
ends as follows:

[...]
09:41:06 allocator.go:315: 0 mis-replicated ranges
09:41:07 test.go:337: test failure: 	allocator.go:321,test_runner.go:755: boom!
09:41:07 test_runner.go:769: tearing down after failure; see teardown.log

Release note: None

@tbg tbg requested a review from andreimatei September 23, 2020 11:32
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)


pkg/cmd/roachtest/test_runner.go, line 760 at r1 (raw file):

	teardownL, err := c.l.ChildLogger("teardown", quietStderr, quietStdout)
	if err != nil {
		panic(err)

what's going on here?
You can just return the error I think.

We perform various operations on teardown which typically produce a few
pages of log output (dead nodes, consistency, getting logs, ...).
These tend to make the real test failure harder to find, so this
commit switches out the loggers before we perform teardown; teardown
will log to `teardown.log` instead. The main log (`test.log`) now
ends as follows:

```
[...]
09:41:06 allocator.go:315: 0 mis-replicated ranges
09:41:07 test.go:337: test failure: 	allocator.go:321,test_runner.go:755: boom!
09:41:07 test_runner.go:769: tearing down after failure; see teardown.log
```

Release note: None
@tbg tbg force-pushed the roachtest-teardown-log branch from c0ee648 to 5537a56 Compare September 30, 2020 08:09
@tbg
Copy link
Member Author

tbg commented Sep 30, 2020

Done. TFTR!

@tbg
Copy link
Member Author

tbg commented Sep 30, 2020

bors r=andreimatei

@craig
Copy link
Contributor

craig bot commented Sep 30, 2020

Build succeeded:

@craig craig bot merged commit 485c196 into cockroachdb:master Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants